rm(list=ls())
library(tidyverse)
library(lubridate)

##### COMPILE SURVEY OPINION DATA FROM MERDEKA ##### 
merdeka <- data.frame(date = c("September 2, 2020", "April 23, 2021", 
                               "May 7, 2021", "November 4, 2022",
                               "February 11, 2023", "August 11, 2023",
                               "November 22, 2023"), # publication date of survey results
                      racial_prob = c(6, 1.9, 2.7, 1.8, 5.2, 2.4, 2.9) # biggest problem facing country
)

merdeka$date <- mdy(merdeka$date)
merdeka_p <- ggplot(data = merdeka, aes(x = date, y = racial_prob)) +
  geom_point() +
  geom_line(linetype = "dashed") +
  scale_y_continuous(name = "% of Respondents Who Think That\nRace is a Big Problem in Malaysia",
                     limits = c(0, 20)) +
  scale_x_date(name = "Date of Survey Publication", date_labels = "%b %Y", date_breaks = "5 months",
               limits = as.Date(c("2020-06-01", "2023-12-31"))) +
  theme_bw() +
  theme(text=element_text(size=6))